<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>检查⼀个数是否为整数</title>
</head>
<body>
    <script>

        var num=prompt('输入整数')
        if(num%1===0){
            alert('是')
        }

        else{
            alert('不是')
        }
    </script>
</body>
</html>